﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mfModifyOrder.aspx.cs" Inherits="msBsc.WebUi.mMall.Seller.mfModifyOrder" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>手机地接客商城</title>
    <%=getMeta()%>
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/mGlobal.css" charset="gbk" />
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/css/home/base.css" charset="gbk" />
    <link href="/jqPlugin/laydate/skins/default/laydate.css" rel="stylesheet" charset="gbk" />
    <link href="/themes/mStyle1/css/public/mOrder.css" rel="stylesheet" />
    <%=getBodyBeforeJs()%>

    <script type="text/javascript" src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/jBase.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/jmPage.js"></script>
    <script type="text/javascript" src="/themes/Style1/jsQt.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/laytpl.js"></script>
    <script type="text/javascript" src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
    <script type="themes/wStyle1/js/comm/DateInfo.js"></script>
    <script type="text/javascript">
        $(window).load(function () {
        });
        //        $(window).bind('resize', function () { _self._ResizeHandler(_self); })
        //        .bind('scroll', function () { _self._ResizeHandler(_self); });
    </script>
    <!--head fix rgn-->
    <style type="text/css">
       
    </style>
    <base target="_self" />
</head>
<body>
    <div class="viewport">
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapHeaderMenuHtml(true) %>
        <form action='#' method="post" id="J_EmailForm">
            <input type="hidden" id="orderId" />
            <div id="c_order" class="c_order">
                <div class="order_comm">
                    <div class="fl_order_comm order_list_number"><span>订单号：</span><span id="orderNumber"></span></div>
                    <div class="fr_order_comm order_list_number order_stime">
                        <div style="padding-right: 10px; width: 100%">
                            <span>下单时间：</span>
                            <span id="singleTime"></span>
                        </div>
                    </div>
                </div>
                <div class="order_comm">
                    <div class="l_order_user">
                        <a id="djack_c_img" class="l_order_user_href">
                            <img id="djack_img" /></a>
                    </div>
                    <div class="r_order_user">
                        <a id="djack_name" class="r_order_user_href"></a>
                    </div>
                </div>
                <div class="end_order_time">
                    <div class="start_time">
                        <div>开始时间</div>
                        <div class="time_info" id="start_time"></div>
                    </div>
                    <div class="stop_time">
                        <div>结束实时间</div>
                        <div class="time_info" id="end_time"></div>
                    </div>
                    <div class="div_order_status">
                        <div>状态</div>
                        <div class="order_status" id="order_status"></div>
                    </div>
                </div>
                 <div class="order_time">
                    <div class="l_order_time"><span>定金比例:</span></div>
                    <div class="c_order_time">
                        <select id="ratio">
                            <option value="0.2">20%</option>
                            <option value="0.5">50%</option>
                        </select>
                    </div>
                    <div class="r_order_time">
                        <span></span>
                    </div>
                </div>
                <div id="vehicle_list">
                    <%--<div class="order_vehicle_info" data-value="{{d.rows[i].VEHICLE_INFO_ID}}">
                        <div class="l_ovi">
                            <div class="c_l_ovi">
                                <img src="{{d.rows[i].VEHICLE_DEFAULT_PIC}}  196x140img.jpg" />
                            </div>
                        </div>

                        <div class="r_ovi">
                            <div>
                                <a class="n_vehicle">{{d.rows[i].VEHICLE_NAME}}</a>
                            </div>
                            <div>
                                <span class="info_vehicle" style="">{{d.rows[i].VEHICLE_SERVICE_TYPE}} / {{d.rows[i].VEHICLE_SEATS}}坐</span>
                            </div>
                            <div class="other_vInfo">
                                <div class="vehicle_price"><span class="v_price">{{d.rows[i].VEHICLE_PRICE_DAY}}</span>￥/天</div>
                            </div>
                        </div>--%>
                </div>
            </div>

            <div id="order_bottom" class="order_bottom">
                <div class="lb_order" style="line-height: 18px">
                    <div>
                        <span class="lb_title">合计:</span><span id="total" class="lb_content"></span>
                    </div>
                    <div class="preferential">
                        <span class="lb_title">定金:</span><span id="preferential" class="lb_content"></span>
                    </div>
                </div>
                <div class="rb_order">
                    <a class="btn_submit btn_change" id="submitOrder" onclick="modifyOrder()">确认修改</a>
                </div>
            </div>

            <xmp id="svc_list_temp_vehicle" style="display: none">
             {{#for(var i=0,len=d.rows.length;i < len;i++){ }}
             <div class="order_vehicle_info" data-value="{{d.rows[i].PRODUCT_ID}}">
                        <div class="l_ovi">
                            <a href="/mp_VehicleInfo.htm?vehicleId={{d.rows[i].PRODUCT_ID}}" class="c_l_ovi">
                                <img src="{{d.rows[i].IMG_URL}}  196x140img.jpg" />
                            </a>
                        </div>

                        <div class="r_ovi">
                            <div>
                                <a class="n_vehicle" href="/mp_VehicleInfo.htm?vehicleId={{d.rows[i].PRODUCT_ID}}">{{d.rows[i].PRODUCT_NME}}</a>
                            </div>
                            <div>
                                <span class="info_vehicle" style="">{{d.rows[i].PRODUCT_SERVICE_NAME}} / {{d.rows[i].PRODUCT_SEATS}}坐</span>
                            </div>
                            <div class="other_vInfo">
                                <div class="vehicle_price"><span class="v_price">{{d.rows[i].PRODUCT_STRIKE_PRICE}}</span>￥/天</div>
                            </div>
                            <div class="preferential">
                                <span>优惠：</span><span><input type="text" pro-value="{{d.rows[i].PRODUCT_STRIKE_PRICE}}" data-value="{{d.rows[i].ORDERS_DETAIL_ID}}" value="{{d.rows[i].DETAIL_DISCOUNT}}" class="price_txt" />￥/天</span>
                            </div>
                        </div>
                    </div>
            {{#} }}
        </xmp>
        </form>
        <script type="text/javascript" src="/jqPlugin/laydate/laydate.js" charset="gbk"></script>
        <script src="/themes/wStyle1/js/comm/DateInfo.js"></script>
        <script type="text/javascript">
            (function () {
                $("#orderId").val(GetQueryStr("orderId"));
                $("#h_title").text("修改价格");
                $.getMessageCount();
                doto();
            })();
            function doto() {
                var opart = new jsonRow();
                opart.AddCell("orderId", $("#orderId").val());
                opart.AddCell("ACTION", "init");
                ajaxComm(opart);
            }
            function setOrder(data) {
                if (IsNull(data) || data.rows.length < 1) {
                    alert("没有该订单");
                    window.location.href = "/ms_OrderList.htm";
                    return;
                }
                $("#orderNumber").text(data.rows[0].ORDER_CODE);
                $("#singleTime").text(formatDate(new Date(data.rows[0].ORDER_TIME)), false);
                $("#djack_img").attr("src", data.rows[0].CUSTOMER_DEFAULT_PIC);
                $("#djack_name").text(data.rows[0].CUSTOMER_NICK);
                $("#start_time").text(formatDate1(new Date(data.rows[0].ORDER_START_TIME)));
                $("#end_time").text(formatDate1(new Date(data.rows[0].ORDER_STOP_TIME)));
                $("#total").text("￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT));
                $("#preferential").text("￥" + getNumber(data.rows[0].PAYABLE_AMT));
                if (data.rows[0].DEPOSIT_RATIO == 0.20) {
                    $("#ratio").val("0.2");
                } else if (data.rows[0].DEPOSIT_RATIO == 0.50) {
                    $("#ratio").val("0.5");
                }
                var _html = $('#svc_list_temp_vehicle').html();

                laytpl(_html).render(data.rows[0], function (render) {
                    $('#vehicle_list').html(render);
                });
                if (data.rows[0].ORDER_STATUS == 1) {
                    $("#order_status").text("待确认");
                }
                else if (data.rows[0].ORDER_STATUS == 2) {
                    $("#order_status").text("待付款");
                }
                else if (data.rows[0].ORDER_STATUS == 3) {
                    $("#order_status").text("已付款");
                }
                else if (data.rows[0].ORDER_STATUS == 4) {
                    $("#order_status").text("已完成");
                }
                else if (data.rows[0].ORDER_STATUS == 5) {
                    $("#order_status").text("已关闭");
                }
                else if (data.rows[0].ORDER_STATUS == 6) {
                    $("#order_status").text("正在退款");
                }
                else if (data.rows[0].ORDER_STATUS == 7) {
                    $("#order_status").text("已退款");
                }
                else if (data.rows[0].ORDER_STATUS == 8) {
                    $("#order_status").text("已取消");
                }
                else if (data.rows[0].ORDER_STATUS == 9) {
                    $("#order_status").text("已删除");
                }
                else if (data.rows[0].ORDER_STATUS == 10) {
                    $("#order_status").text("已取消退款");
                }
                else if (data.rows[0].ORDER_STATUS == 11) {
                    $("#order_status").text("拒绝退款");
                }
                else if (data.rows[0].ORDER_STATUS == 12) {
                    $("#order_status").text("已拒绝订单");
                }
            }

            function modifyOrder() {
                var orderList = "";
                var isPrice = false;
                $.each($(".price_txt"), function (i, item) {
                    if (i > 0) {
                        orderList += "|";
                    }
                    var price = $(this).val();
                    if (!IsPositiveFloat(price) || parseFloat(price) >= parseFloat($(this).attr("pro-value"))) {
                        isPrice = true;
                        $(this).focus();
                        alert("优惠价格只能是小于单价的正数");
                        return;
                    }
                    orderList += $(this).attr("data-value") + "," + price;
                });
                if (isPrice) {
                    return;
                }
                var ratio = $("#ratio").val();
                if (ratio!=0.5) {
                    ratio = 0.2;
                }
                var opart = new jsonRow();
                opart.AddCell("orderId", $("#orderId").val());
                opart.AddCell("orderList", orderList);
                opart.AddCell("bili", ratio);
                opart.AddCell("ACTION", "modifyOrder");
                ajaxComm(opart);
            }
        </script>
    </div>
</body>
<%=getBodyAfterJs() %>
</html>

